package com.sporadic.desk.controller;

import com.sporadic.desk.service.MenuService;
import dto.MenuDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import vo.ResponseData;

import java.util.List;

/**
 * @program: sporadic
 * @description:
 * @author: LHD   QQ:1727865856
 * @create: 2019-10-28 12:37
 **/
@RestController
@CrossOrigin(value = "http://localhost:8080")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @GetMapping("/queryMenuName")
    public ResponseData<List<MenuDTO>> query(Integer mid) {
        List<MenuDTO> menuList = menuService.queryName(mid);
        return new ResponseData<>(menuList);
    }
}
